﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TribesPSO
{
    /// <summary>
    /// This interface allows a user to specify their own function to minimize with an existing PSO implementation
    /// </summary>
    public interface IObjectiveFunction
    {
        /// <summary>
        /// The number of dimensions in the function to be minimized
        /// </summary>
        int Dimensions { get; }

        /// <summary>
        /// The minimum bounds of the search space.  Depending on the implementation of the searchspace, 
        /// Particles may go outside of the minimum bounds but new particles should never be generated
        /// outside of the minimum bounds
        /// </summary>
        EuclidianVector MinBounds { get; }

        /// <summary>
        /// The maximum bounds of the search space.  Depending on the implementation of the searchspace, 
        /// Particles may go outside of the maximum bounds but new particles should never be generated
        /// outside of the maximum bounds
        /// </summary>
        EuclidianVector MaxBounds { get; }

        /// <summary>
        /// A guess at the the location of the global minimum of the function.  Null if there is no initial
        /// guess
        /// </summary>
        EuclidianVector InitialGuess { get; }

        /// <summary>
        /// Evaluate the the function to be minimized at the specific point.
        /// </summary>
        /// <param name="position"></param>
        /// <returns></returns>
        double Evaluate(EuclidianVector position);
    }
}
